import vc from '@/assets/scss/mapVariables.less';

export default {
  methods: {
    // 展示热力图
    showHotPowerLayer () {
      const { map } = this;
      const nums1 = ['<', ['get', 'nums'], 50];
      const nums2 = ['all', ['>=', ['get', 'nums'], 50], ['<', ['get', 'nums'], 100]];
      const nums3 = ['all', ['>=', ['get', 'nums'], 100], ['<', ['get', 'nums'], 150]];
      const nums4 = ['all', ['>=', ['get', 'nums'], 150], ['<', ['get', 'nums'], 200]];
      const nums5 = ['>=', ['get', 'nums'], 200];

      map.addLayer({
        id: 'hotPowerLayer',
        type: 'fill',
        source: 'focuseArea',
        layout: {},
        paint: {
          'fill-opacity': 1,
          'fill-outline-color': '#fff',
          'fill-color': ['case',
            nums1, vc.gradualChangeBlue1,
            nums2, vc.gradualChangeBlue2,
            nums3, vc.gradualChangeBlue3,
            nums4, vc.gradualChangeBlue4,
            nums5, vc.gradualChangeBlue5,
            vc.gradualChangeBlue1
          ]
        }
      }, 'focuseAreaNameLayer');
    }
  }
};